<html  xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>财富管家X-管理员</title>
  <meta name="renderer" content="webkit|ie-comp|ie-stand">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <link rel="shortcut icon" th:href="@{images/littlelogo.png}" >
  <link rel="icon" th:href="@{/favicon.ico}"  mce_href="/favicon.ico" type="image/x-icon"/>
  <link rel="stylesheet" th:href="@{/css/font.css}">
  <link rel="stylesheet" th:href="@{/css/xadmin.css}">
  <script type="text/javascript" th:src="@{/js/jquery-3.2.1.min.js}"></script>
  <script th:src="@{/lib/layui/layui.js}" charset="utf-8"></script>
  <script type="text/javascript" th:src="@{/js/xadmin.js}"></script>
  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>

  <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
  <!--[if lt IE 9]>
  <script th:src="@{/js/html5.min.js}" type="text/javascript"></script>
  <script th:src="@{/js/respond.min.js}" type="text/javascript"></script>
  <![endif]-->
</head>
  
  <body>
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">众筹管理</a>
        <a>
          <cite>众筹列表</cite></a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
    </div>
    <div class="x-body">

      <table class="layui-table">
        <thead>
        <tr>

          <th>项目Id</th>
          <th>项目名称</th>
          <th>众筹金额</th>
          <th>用户姓名</th>
          <th>面向人群</th>
          <th>开始时间</th>
          <th>结束时间</th>
          <th style="width: 150px;">项目简介</th>
          <th >已筹款金额</th>
        </tr>
        </thead>
        <tbody>
        <tr  th:each="crowds:${list}">
          <td th:text="${crowds.id}">1</td>
          <td th:onclick="'javascript:look('+${crowds.id}+')'" th:text="${crowds.projectname}">XXX项目</td>
          <td th:text="${crowds.money}">782000元</td>
          <td th:text="${crowds.name}">王凯平</td>
          <td th:text="${crowds.faceto}">青少年</td>
          <td th:text="${#dates.format(crowds.createtime, 'yyyy-MM-dd hh:mm:ss')}">开始时间</td>
          <td th:text="${#dates.format(crowds.endtime, 'yyyy-MM-dd hh:mm:ss')}">结束时间</td>
          <td th:text="${crowds.projectabstract}" style="width: 150px;">项目简介</td>
          <td th:text="${crowds.nowmoney}">项目简介</td>
        </tr>
        </tbody>
      </table>
      <div class="page">
        <div id="pagination"></div>
      </div>
    </div>
    <script th:inline="javascript">
        /*<![CDATA[*/
        var count = [[${count}]];//总记录数
        var curr = [[${curr}]];//当前页
        var contextPath = [[${#request.getContextPath()}]]; //获取当前应用路径
        // var username = [[${keyword}]]
        /*]]>*/


    </script>
    <script type="text/javascript">

        function look(id){
            console.log(id)
            parent.layer.open({
                type: 2,
                title: 'layer mobile页',
                shadeClose: true,
                shade: 0.8,
                area: ['380px', '90%'],
                content:contextPath+ '/crowdfunding/info?crowdId='+id
            });
        }

        layui.use('laypage', function(){
            var laypage = layui.laypage;

            //执行一个laypage实例
            laypage.render({
                elem: 'pagination' //注意，这里的 data 是 ID，不用加 # 号
                ,count: count //数据总数，从服务端得到
                ,curr: curr
                // ,username: username
                ,limit: 5
                ,jump: function(obj, first){
                    //obj包含了当前分页的所有参数，比如：
                    console.log(obj.curr); //得到当前页，以便向服务端请求对应页的数据。
                    console.log(obj.limit); //得到每页显示的条数
                    //首次不执行
                    if(!first){
                        // window.location.href = contextPath + "/chat?page=" + (obj.curr) + "&size=" + obj.limit+ "&keyword=" + obj.username
                        window.location.href = contextPath + "/crowdfunding/crowdfunding_list?page=" + (obj.curr) + "&size=" + obj.limit
                    }
                }
            });
        });
    </script>

  </body>

</html>